<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="zh-CN" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>后台页面-上海市嘉定区人民法院</title>
<link rel="stylesheet" type="text/css"
			href="admin/ext/resources/css/ext-all.css" />
<script type="text/javascript" src="admin/ext/adapter/ext/ext-base.js"></script>
		<!-- ENDLIBS -->
		<script type="text/javascript" src="admin/ext/ext-all.js"></script>

		<script type="text/javascript" src="admin/ext/ext-lang-zh_CN.js"></script>
<style>

body{background:url(images/main_bg_03.png) repeat;}
.list-content {
    width:802px;
	height:540px;
	font-size:12px;
	text-align:left;
	border:2px solid #92b0c6;
	color:#666;
	display:inline-block;
}
.list_page{
    margin-right:10px;
	margin-top:5px;
	width: 802px;
	line-height:18px;
	font-size:12px;
	text-align:right;
	color:#666;
	display:inline;
	float:left; 
}
.list_page_text{
	color:#146185;
	}
.td01{
	width:6px;
	padding-left:3px;
	}
.btn01 {
	width:44px;
	height:28px;
	background:url(images/btn_list.png) no-repeat;
	display:inline;
}

a{text-decoration:none;color:#666;}
a:hover{color:#FF9900;}
</style>
    <base href="<%=basePath%>">
    
    <title>My JSP 'list.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script type="text/javascript" src="web/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
function nowPage(nPage,countPage,type,action){
   if (type==1){
   		if(countPage>nPage){
   		    alert("这已经是最后一页了！");
   			return false;
   		}else if(countPage<1){
   		alert("这已经是第一页了！");
   			return false;
   		}
   		var a= encodeURI(encodeURI(action))+"?pageNum="+countPage;
		window.location=a;
   }else{
      var inputPage = document.getElementById("cardId").value;
   		if(inputPage>nPage){
   		alert("超过了最大页数！");
   			return false;
   		}else if(inputPage<1){
   		alert("超过了最小页数！");
   			return false;
   		}
   		var a= encodeURI(encodeURI(action))+"?pageNum="+inputPage;
		window.location=a;
   }
}
function modifyMailbox(mailID){
	window.location="editMailbox.action?mailID="+mailID;
}
function deleteMailbox(mailID)
{
	if (confirm("是否确认删除"))  
	{  
		$.ajax({
				type: "POST",
				url: "deleteMessage.action?mailID="+mailID,
				dateType: "json",
				success: function(returnedData){
						
						var json = eval( "("+returnedData+")" );
						alert(json.confirmDel);
						window.location="mailboxlist.action";
				}
			});
	}  
	else  
	{ 
	return false;
	};
	
}

</script>
  </head>
  
  <body>
     <div class="list-content"> 
     
     <table  width="800" cellpadding="1" cellspacing="1">
	 
	  
		<s:iterator value="childPage.showMailBox" var="val" status="status">
	    <s:if test="#status.odd">
		    	 <tr bgcolor="#d3e8f1">
			</s:if>
		    <s:else>
	    	 	 <tr>
	  	  </s:else>
	  	  
	  	   <td class="td01"><img src="images/li.gif" border="0" width="3" height="3" /></td>
		  <td width="70%"><s:property value="#val.title"/></td>
		  <td width="70">[<s:date name="#val.insertTime" format="yyyy-MM-dd" />]</td>
		  <td width="30"></td>
		  <td width="44"> <input type="button" id="modify" onclick="modifyMailbox(<s:property value="#val.id"/>);"   name="modify" value="回复"  style="width:42px; height:24px; border:none; background:url(images/btn_list.png) no-repeat;margin-right:2px; cursor:pointer; display:inline;" /></td>
		  <td width="42"><input type="button"   id="delete" onclick="deleteMailbox(<s:property value="#val.id"/>);" name="delete" value="删除" style="width:42px; height:24px; border:none; background:url(images/btn_list.png) no-repeat;cursor:pointer; display:inline;" /></td>
		</tr>
		</s:iterator>
	  </table> 
	 </div>
	<div class="list_page">  共 <s:property value="childPage.resultCount"/>条        
	第   <s:property value="childPage.curPage"/>/<s:property value="childPage.pageCount"/>  页
	<a  style="cursor:pointer" onclick="nowPage(1,1,1,'mailboxlist.action' )"><span class="list_page_text"> 首页</span>
	</a>  
	<a style="cursor:pointer" onclick="nowPage(<s:property value="childPage.pageCount"/> ,<s:property value="childPage.curPage"/>-1,1,'mailboxlist.action')">上一页</a>  
	<a style="cursor:pointer" onclick="nowPage(<s:property value="childPage.pageCount"/> ,<s:property value="childPage.curPage"/>+1,1,'mailboxlist.action')">下一页</a> 
	 <a style="cursor:pointer" onclick="nowPage(<s:property value="childPage.pageCount"/> ,<s:property value="childPage.pageCount"/>,1,'mailboxlist.action')"><span class="list_page_text">  尾页</span></a>   
	 转到第  <input size="7" maxlength="2" type="text"  value="1"class="inputText" id="cardId" name="cardId" style="width:12px" height="12px; vertical-align:middle" /> 页
	 <a style="cursor:pointer" onclick="nowPage(<s:property value="childPage.pageCount"/>,0,2,'mailboxlist.action')"><img src="images/go_btn.png" border="0" width="20" height="26" align="middle" /></a> </div>
	
	
     
    
  </body>
</html>
